﻿<%@ Page Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="AddNewDeliveryNote.aspx.cs"
    Title="Xtablish CRM / New Delivery Note" Inherits="Web.Delivery_Note.AddNewDeliveryNote" %>

<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>

<asp:Content ID="Content1" ContentPlaceHolderID="headContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Con1" runat="server">
   <link rel="stylesheet" type="text/css" href="../CSS/style.css" />
    <link rel="stylesheet" type="text/css" href="../CSS/bootstrap.min.css" />
    <link href="../CSS/Fonts.css" rel='stylesheet' type='text/css' />
    <script src="../JS/jquery.min.js"></script>
    <script src="../JS/bootstrap.min.js"></script>
    <script src="../JS/verify.notify.min.js"></script>
    <link href="../CSS/jquery-ui.css" rel='stylesheet' type='text/css' />
    <script src="../JS/jquery-ui.min.js"></script>
   
    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
        <script type="text/javascript">
            function WebForm_OnSubmit() {
                if (typeof (ValidatorOnSubmit) == "function" && ValidatorOnSubmit() == false) {
                    $("#validation_dialog").dialog({
                        title: "Validation Error!",
                        modal: true,
                        resizable: false,
                        buttons: {
                            Close: function () {
                                $(this).dialog('close');
                            }
                        }
                    });
                    return false;
                }
                return true;
            }
            function isNumberKey(evt) {
                var charCode = (evt.which) ? evt.which : event.keyCode
                if (charCode > 31 && (charCode < 48 || charCode > 57))
                    return false;
                return true;
            }
            function disableKeyPress(evt) {
                return false;
            }
            function CancelClick() {
                window.location.assign(document.getElementById('<%= hdntxtPrevPage.ClientID %>').value);
            }
        </script>
    </telerik:RadCodeBlock>
    <asp:HiddenField ID="hdntxtPrevPage" runat="server"></asp:HiddenField>
    <div class="register">
        <telerik:RadWindowManager ID="RadWindowManager1" runat="server">
            <Windows>
                <telerik:RadWindow runat="server" NavigateUrl="Dialog1.aspx" ID="Window1"></telerik:RadWindow>
            </Windows>
        </telerik:RadWindowManager>
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="lbtnAddNewProduct">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="RadGrid1"></telerik:AjaxUpdatedControl>
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
        </telerik:RadAjaxManager>
        <div class="container-fluid">
            <div class="row">
                <div class="col-md-6">
                    <h3>Creating New Delivery Note</h3>
                </div>
                <div class="col-md-6 btn-edit">
                    <button type="button" id="btnTop_Save" runat="server" class="btn btn-defaul" onserverclick="btn_Save_Click">
                        <i class="glyphicon glyphicon-floppy-saved"></i>&nbsp Save
                    </button>
                    <div id="validation_dialog" style="display: none">
                        <asp:ValidationSummary ID="ValidationSummary1" runat="server" />
                    </div>
                    <button type="button" class="btn btn-defaul" onclick="CancelClick()">
                        <i class="glyphicon glyphicon-remove"></i>&nbsp Cancel
                    </button>
                </div>
            </div>
            <div class="row">
                <div class="edit-form highlight">
                    <div class="control-group">
                        <h4>Delivery Note Information</h4>
                    </div>
                    <div class="control-group">
                        <div class="col-md-6 distance-control">
                            <div class="col-md-4">
                                <label class="control-label">Company <span class="red-star">*</span></label>
                            </div>
                            <div class="col-md-8">
                                <div class="controls">
                                    <asp:TextBox ID="txtOrganization" runat="server" class="form-control form-fl" data-validate="required" onkeypress="return disableKeyPress(event)"/>
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" Display="None" ControlToValidate="txtOrganization"
                                        runat="server" ErrorMessage="Company Name is required."></asp:RequiredFieldValidator>
                                    <div class="btn-sl">
                                        <button class="btn btn-defaul">
                                            <span class="glyphicon glyphicon-search"></span>
                                        </button>
                                        <button class="btn btn-defaul">
                                            <span class="glyphicon glyphicon-remove"></span>
                                        </button>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="col-md-6 distance-control">
                            <div class="col-md-4">
                                <label class="control-label">Contact Name </label>
                            </div>
                            <div class="col-md-8">
                                <div class="controls">
                                    <asp:TextBox ID="txtContactName" runat="server" class="form-control form-fl" />
                                    <div class="btn-sl">
                                        <button class="btn btn-defaul">
                                            <span class="glyphicon glyphicon-search"></span>
                                        </button>
                                        <button class="btn btn-defaul">
                                            <span class="glyphicon glyphicon-remove"></span>
                                        </button>
                                    </div>
                                </div>
                            </div>

                        </div>
                        <div class="clearfix"></div>
                    </div>
                    <div class="control-group">
                        <div class="col-md-6 distance-control">
                            <div class="col-md-4">
                                <label class="control-label">Delivery Date </label>
                            </div>
                            <div class="col-md-8">
                                <div class="controls">
                                    <telerik:RadDatePicker ID="dpDeliveryDate" runat="server" Width="50%">
                                        <DateInput ReadOnly="true" ID="RadDateInput1" runat="server">
                                        </DateInput>
                                        <Calendar ReadOnly="true" ID="Calendar1" runat="server" UseColumnHeadersAsSelectors="False"
                                            UseRowHeadersAsSelectors="False" ViewSelectorText="x">
                                            <SpecialDays>
                                                <telerik:RadCalendarDay Repeatable="Today" ItemStyle-CssClass="rcToday">
                                                </telerik:RadCalendarDay>
                                            </SpecialDays>
                                        </Calendar>
                                    </telerik:RadDatePicker>
                                </div>
                            </div>
                        </div>
                        <div class="col-md-6 distance-control">
                            <div class="col-md-4">
                                <label class="control-label">Type </label>
                            </div>
                            <div class="col-md-8">
                                <div class="controls">
                                    <telerik:RadComboBox ID="ddlType" runat="server"
                                        Width="60%" Filter="StartsWith" MaxHeight="700px"/>
                                </div>
                            </div>
                        </div>
                        <div class="clearfix"></div>
                    </div>
                    <div class="control-group">
                        <div class="col-md-6 distance-control">
                            <div class="col-md-4">
                                <label class="control-label">Sales Order </label>
                            </div>
                            <div class="col-md-8">
                                <div class="controls">
                                    <asp:TextBox ID="txtSalesOrder" runat="server" class="form-control form-fl" />
                                    <div class="btn-sl">
                                        <button class="btn btn-defaul">
                                            <span class="glyphicon glyphicon-search"></span>
                                        </button>
                                        <button class="btn btn-defaul">
                                            <span class="glyphicon glyphicon-remove"></span>
                                        </button>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="col-md-6 distance-control">
                            <div class="col-md-4">
                                <label class="control-label">Carrier </label>
                            </div>
                            <div class="col-md-8">
                                <div class="controls">
                                    <telerik:RadComboBox ID="ddlCarrier" runat="server"
                                        Width="60%" Filter="StartsWith" MaxHeight="700px"/>
                                </div>
                            </div>
                        </div>
                        <div class="clearfix"></div>
                    </div>
                    <div class="control-group">
                        <div class="col-md-6 distance-control">
                            <div class="col-md-4">
                                <label class="control-label">Invoice</label>
                            </div>
                            <div class="col-md-8">
                                <div class="controls">
                                    <asp:TextBox ID="txtInvoice" runat="server" class="form-control form-fl" />
                                    <div class="btn-sl">
                                        <button class="btn btn-defaul">
                                            <span class="glyphicon glyphicon-search"></span>
                                        </button>
                                        <button class="btn btn-defaul">
                                            <span class="glyphicon glyphicon-remove"></span>
                                        </button>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="col-md-6 distance-control">
                            <div class="col-md-4">
                                <label class="control-label">Tracking No </label>
                            </div>
                            <div class="col-md-8">
                                <div class="controls">
                                    <asp:TextBox ID="txtTrakingNo" runat="server" class="form-control" />
                                </div>
                            </div>
                        </div>
                        <div class="clearfix"></div>
                    </div>
                    <div class="control-group">
                        <div class="col-md-6 distance-control">
                            <div class="col-md-4">
                                <label class="control-label">Assigned to</label>
                            </div>
                            <div class="col-md-8">
                                <div class="controls">
                                    <telerik:RadComboBox ID="ddlAssignedto" runat="server"
                                        Width="60%" Filter="StartsWith" MaxHeight="700px"/>
                                </div>
                            </div>
                        </div>
                        <div class="clearfix"></div>
                    </div>
                </div>
            </div>
            <!-- end row 1 -->
            <div class="row">
                <div class="edit-form highlight">
                    <div class="control-group">
                        <h4>Address Information</h4>
                    </div>

                    <div class="control-group">
                        <div class="col-md-6 distance-control">
                            <div class="col-md-4">
                                <label class="control-label">Street</label>
                            </div>
                            <div class="col-md-8">
                                <div class="controls">
                                    <asp:TextBox ID="txtStreet" runat="server" class="form-control" />
                                </div>
                            </div>
                        </div>
                        <div class="col-md-6 distance-control">
                            <div class="col-md-4">
                                <label class="control-label">PO Box</label>
                            </div>
                            <div class="col-md-8">
                                <div class="controls">
                                    <asp:TextBox ID="txtPOBox" runat="server" class="form-control" />
                                </div>
                            </div>
                        </div>
                        <div class="clearfix"></div>
                    </div>
                    <div class="control-group">
                        <div class="col-md-6 distance-control">
                            <div class="col-md-4">
                                <label class="control-label">ZIP</label>
                            </div>
                            <div class="col-md-8">
                                <div class="controls">
                                    <asp:TextBox ID="txtZip" runat="server" class="form-control" />
                                </div>
                            </div>
                        </div>
                        <div class="col-md-6 distance-control">
                            <div class="col-md-4">
                                <label class="control-label">City</label>
                            </div>
                            <div class="col-md-8">
                                <div class="controls">
                                    <asp:TextBox ID="txtCity" runat="server" class="form-control" />
                                </div>
                            </div>
                        </div>
                        <div class="clearfix"></div>
                    </div>

                    <div class="control-group">
                        <div class="col-md-6 distance-control">
                            <div class="col-md-4">
                                <label class="control-label">Country</label>
                            </div>
                            <div class="col-md-8">
                                <div class="controls">
                                    <asp:TextBox ID="txtCountry" runat="server" class="form-control" />
                                </div>
                            </div>
                        </div>
                        <div class="col-md-6 distance-control">
                            <div class="col-md-4">
                                <label class="control-label">State</label>
                            </div>
                            <div class="col-md-8">
                                <div class="controls">
                                    <asp:TextBox ID="txtState" runat="server" class="form-control" />
                                </div>
                            </div>
                        </div>
                        <div class="clearfix"></div>
                    </div>
                </div>
            </div>
            <!-- end row 2 -->
            <div class="row">
                <div class="edit-form highlight">
                    <div class="control-group">
                        <h4>Item Details</h4>
                    </div>
                    <div style="width: 100%">
                        <telerik:RadGrid ID="RadGrid1" ShowStatusBar="True" runat="server" AllowPaging="True" AllowSorting="True" AllowMultiRowSelection="True"
                            AutoGenerateColumns="False" GridLines="None" Width="100%" OnNeedDataSource="RadGrid1_NeedDataSource" OnItemCommand="RadGrid1_ItemCommand">
                            <ClientSettings EnableRowHoverStyle="true"></ClientSettings>

                            <MasterTableView PageSize="10" NoDetailRecordsText="No records" NoMasterRecordsText="No records" ShowHeader="true" CommandItemDisplay="Top" TableLayout="Fixed" >
                                <CommandItemTemplate>
                                    <asp:LinkButton ID="lbtnAddNewProduct" runat="server" CommandName="Insert">
                                        <img style="border:0px" alt="" src="../Images/add.png" /> 
                                        Add New Product
                                    </asp:LinkButton>
                                </CommandItemTemplate>
                                <Columns>
                                    <telerik:GridButtonColumn Text="Delete" CommandName="Delete" ButtonType="ImageButton" ConfirmDialogType="RadWindow"
                                        ImageUrl="~/Images/delete.png" ConfirmText="Are you sure want to delete this product ?" ConfirmTitle="Delete" ConfirmDialogHeight="25px">
                                        <HeaderStyle Font-Bold="true" HorizontalAlign="center" Width="5%" />
                                        <ItemStyle HorizontalAlign="center" Width="12px" Height="12px" />
                                    </telerik:GridButtonColumn>
                                    <telerik:GridTemplateColumn HeaderText="Item Name" UniqueName="Column1">
                                        <HeaderStyle Font-Bold="true" HorizontalAlign="center" Width="30%" />
                                       <ItemStyle Wrap="false" HorizontalAlign="center" Width="30%" />
                                        <ItemTemplate>
                                            <div class="btn-sl">
                                                <asp:TextBox ID="txtProduct" runat="server" class="form-control" placeholder="Select Product"
                                                    Text='<%# Bind( "ProductName") %>' Width="70%"></asp:TextBox>
                                                <button class="btn btn-defaul">
                                                    <span class="glyphicon glyphicon-search"></span>
                                                </button>
                                                <button class="btn btn-defaul">
                                                    <span class="glyphicon glyphicon-remove"></span>
                                                </button>
                                            </div>
                                        </ItemTemplate>
                                    </telerik:GridTemplateColumn>
                                    <telerik:GridTemplateColumn HeaderText="Item Description" UniqueName="Column1">
                                        <HeaderStyle Font-Bold="true" HorizontalAlign="center" Width="40%" />
                                       <ItemStyle Wrap="false" HorizontalAlign="center" Width="40%" />
                                        <ItemTemplate>
                                            <asp:TextBox ID="txtProductDescription" runat="server" TextMode="MultiLine" placeholder="Product Description"
                                                Text='<%# Bind( "ProductDescription") %>' CssClass="form-control" Rows="1" Width="80%"></asp:TextBox>
                                        </ItemTemplate>
                                    </telerik:GridTemplateColumn>
                                    <telerik:GridTemplateColumn HeaderText="Quantity" UniqueName="Column1">
                                        <HeaderStyle Font-Bold="true" HorizontalAlign="center" Width="25%" />
                                        <ItemStyle HorizontalAlign="center" Width="25%" />
                                        <ItemTemplate>
                                            <asp:TextBox ID="txtQuantity" runat="server" class="form-control" placeholder="Quantity"
                                                Text='<%# Bind( "Quantity") %>' onkeypress="return isNumberKey(event)" Width="80%"></asp:TextBox>
                                        </ItemTemplate>
                                    </telerik:GridTemplateColumn>
                                </Columns>
                                <PagerStyle HorizontalAlign="Right" Mode="NextPrevNumericAndAdvanced" PagerTextFormat="Page: {4} &amp;nbsp;|&amp;nbsp; Current Page: {0} / {1}, Items: {2} - {3} / {5}." AlwaysVisible="True" />
                            </MasterTableView>
                            <PagerStyle Mode="NumericPages"></PagerStyle>
                        </telerik:RadGrid>
                    </div>
                </div>
                <div class="clearfix"></div>
            </div>
            <div class="row">
                <div class="col-md-12 btn-edit">
                    <button type="button" id="btnBottom_Save" runat="server" onserverclick="btn_Save_Click" class="btn btn-defaul">
                        <i class="glyphicon glyphicon-floppy-saved"></i>&nbsp Save
                    </button>
                    <button type="button" class="btn btn-defaul" onclick="CancelClick()">
                        <i class="glyphicon glyphicon-remove"></i>&nbsp Cancel
                    </button>
                </div>
            </div>
        </div>
    </div>   
</asp:Content>
